package org.example.di.pro1_value_annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@ComponentScan
@PropertySource(value = {"classpath:product.properties"})    //指定properties文件的位置，让spring容器加载pproperties文件
public class AppTest_Value {
    public static void main(String[] args) {
        ApplicationContext context=new AnnotationConfigApplicationContext(AppTest_Value.class);
        Product p=context.getBean(Product.class);
        System.out.println(p);

    }

}
